
Scx, Scxz, Ssx1, Ssz1, Ssxz1, Ssx2, Ssz2, Ssxz2, Ssx3, Ssz3, Ssxz3 = stress_for_originlab(30);
np.savetxt("results\\stressdatacx.txt", Scx)
np.savetxt("results\\stressdatacxz.txt", Scxz)

np.savetxt("results\\stressdatasx1.txt", Ssx1)
np.savetxt("results\\stressdatasz1.txt", Ssz1)
np.savetxt("results\\stressdatasxz1.txt", Ssxz1)

np.savetxt("results\\stressdatasx2.txt", Ssx2)
np.savetxt("results\\stressdatasz2.txt", Ssz2)
np.savetxt("results\\stressdatasxz2.txt", Ssxz2)

np.savetxt("results\\stressdatasx3.txt", Ssx3)
np.savetxt("results\\stressdatasz3.txt", Ssz3)
np.savetxt("results\\stressdatasxz3.txt", Ssxz3)

#=
midasX = 0:25/200.0:25;
midasZ = -0.79:1.575/40.0:0.785;
midasSX =  1.0e6*np.loadtxt("midasSX.dat");
midasSZ =  1.0e6*np.loadtxt("midasSZ.dat");
midasSXZ =  1.0e6*np.loadtxt("midasSXZ.dat");
=#
ngpz = 80
gz0 = gausslegendre(ngpz); gaussdataz = [gz0[1] gz0[2]]
(xp, zpc, zps, stressdatacx, stressdatacxz, stressdatasx2, stressdatasz2, stressdatasxz2) = stress_for_matplotlib(30)
level1 = [-500, -350, -200, -50, 100 ]*1e6
level2 = [-2.0, -1.5, -1.0, -0.5, -0.1 ]*1e6
level3 = [-70, -60, -40, -15.0]*1e6
fig1 = plt.contour(xp, zps, transpose(stressdatasx2), level1, cmap="hsv", linewidths=2, linestyles="solid");
##fig2 = plt.contour(midasX, midasZ, midasSXZ, linspace(minval, maxval,10), cmap="hsv", linewidths=1, linestyles="--");
plt.colorbar(fig1, ticks= level1)
#plt.clabel(fig, inline=false, fontsize=10)
plt.show()
